home *** CD-ROM | disk | FTP | other *** search
/ F1 Licenseware / F1 Licenseware - Volume 1.iso / disks / 050a.dms / 050a.adf / EXAMPLE_PROGRAMS / example07.AMOS / example07.amosSourceCode
AMOS Source Code  |  1992-02-26  |  2KB  |  68 lines

  1. '================= 
  2. 'EXAMPLE PROGRAM 7 
  3. '================= 
  4. '*****important to breakout of this program hold down CTRL and press C   
  5.  
  6. 'Plese note, some lines are longer than the screen width,to read these lines 
  7. 'use the left cursor key on keyboard or click on arrow,bottom right of screen
  8.  
  9. Rem you should know these commands by now  
  10. '----------------------------------------- 
  11. Paper 0 : Hide : Cls 0
  12.  
  13.  
  14. Rem set the variable SCORE to 0
  15. '------------------------------- 
  16. SCORE=0
  17.  
  18.  
  19. Rem This is a label a place we can tell the program to GOTO if certain 
  20. Rem conditions are met.
  21. '----------------------------------------------------------------------
  22. L1:
  23.  
  24.  
  25. Rem Assign the variable RN a random number between 0-99  
  26. '------------------------------------------------------- 
  27. RN=Rnd(100)
  28.  
  29.  
  30. Rem Another label
  31. '----------------
  32. L2:
  33.  
  34.  
  35. Rem clear the screen   
  36. '------------------- 
  37. Cls 0
  38.  
  39.  
  40. Rem Set the print position to the top left of the screen and print the score 
  41. '--------------------------------------------------------------------------- 
  42. Locate 0,0 : Print "SCORE ";SCORE
  43.  
  44.  
  45. Rem set the print position and get user input, hold this in the variable GUESS 
  46. '----------------------------------------------------------------------------- 
  47. Locate 0,4 : Line Input "WHAT IS YOUR GUESS? (0-99) ";GUESS
  48.  
  49.  
  50. Rem If the users input(GUESS) is the same as the random number (RN) then 
  51. Rem print correct,sound the bell effect, add 1 to score, wait 2 seconds, 
  52. Rem jump to label 1.   
  53. '--------------------------------------------------------------------------- 
  54. If GUESS=RN Then Locate 0,20 : Print "Correct" : Bell : Inc SCORE : Wait 100 : Goto L1
  55.  
  56.  
  57. Rem if users guess is more than > random number print TOO high,sound shoot 
  58. Rem wait 2 seconds then jump (GOTO) the label called L2
  59. '----------------------------------------------------------------------------
  60. If GUESS>RN Then Locate 0,20 : Print "TOO HIGH" : Shoot : Wait 100 : Goto L2
  61.  
  62.  
  63. Rem if guess is < (less than) RN then prompt TOO LOW,boom,wait 2 secs,goto L2  
  64. '------------------------------------------------------------------------------- 
  65. If GUESS<RN Then Locate 0,20 : Print "TOO LOW" : Boom : Wait 100 : Goto L2
  66.  
  67.  
  68. Rem Amos will never reach here